package com.heyqing.greedy;

/**
 * ClassName:Activity
 * Package:com.heyqing.greedy
 * Description:
 *  定义活动结构体
 * @Date:2024/5/27
 * @Author:Heyqing
 */
public class Activity implements Comparable<Activity> {
    //活动开始时间
    int start;
    //活动结束时间
    int finish;

    public Activity(int start, int finish) {
        this.start = start;
        this.finish = finish;
    }

    @Override
    public int compareTo(Activity other) {
        // 按照结束时间升序排序
        return this.finish - other.finish;
    }
}